package com.taoge.electricalAppSystem.domain;



import com.taoge.electricalAppSystem.service.ShoppingServicesimpl;

import java.util.Scanner;

public class User {

    public static final Scanner INPUT = new Scanner(System.in);
    public static final ShoppingServicesimpl check = new ShoppingServicesimpl();
    private String name;
    private String passWord;
    private String otherName;
    private Integer age;

    public User(String name, String passWord, String otherName, Integer age) {
        this.name = name;
        this.passWord = passWord;
        this.otherName = otherName;
        this.age = age;
    }

    public User() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getOtherName() {
        return otherName;
    }

    public void setOtherName(String otherName) {
        this.otherName = otherName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (name != null ? !name.equals(user.name) : user.name != null) return false;
        if (passWord != null ? !passWord.equals(user.passWord) : user.passWord != null) return false;
        if (otherName != null ? !otherName.equals(user.otherName) : user.otherName != null) return false;
        return age != null ? age.equals(user.age) : user.age == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (passWord != null ? passWord.hashCode() : 0);
        result = 31 * result + (otherName != null ? otherName.hashCode() : 0);
        result = 31 * result + (age != null ? age.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return name +"\t\t" + passWord +"\t\t" + otherName +"\t\t" + age;
    }
}
